x11: Handle XINotifyPassiveGrab/Ungrab in focus events
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 4 Dec 2013 11:49:02 +0000 (12:49 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 5 Dec 2013 02:22:23 +0000 (21:22 -0500)
The focus handling code is shared between core and XI2 implementations,
so just handle the extra XI2 types for passive grabs. Those must be dealt
with in the same way than active grabs. Focus events with this crossing
mode could happen currently through the XIGrabFocusIn passive grab.

https://bugzilla.gnome.org/show_bug.cgi?id=719762

gdk/x11/gdkdevicemanager-core-x11.c

index 96114895cac98475dc664a95bb4e5f9ba82b92e7..db5543b7b74cd8646c0a96837259f497aa843085 100644 (file)
@@ -842,6 +842,10 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
        */
       if (toplevel->has_pointer &&
           mode != NotifyGrab &&
+#ifdef XINPUT_2
+         mode != XINotifyPassiveGrab &&
+         mode != XINotifyPassiveUngrab &&
+#endif /* XINPUT_2 */
           mode != NotifyUngrab)
         toplevel->has_pointer_focus = (focus_in) ? FALSE : TRUE;
 
@@ -849,6 +853,10 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
     case NotifyNonlinear:
     case NotifyNonlinearVirtual:
       if (mode != NotifyGrab &&
+#ifdef XINPUT_2
+         mode != XINotifyPassiveGrab &&
+         mode != XINotifyPassiveUngrab &&
+#endif /* XINPUT_2 */
           mode != NotifyUngrab)
         toplevel->has_focus_window = (focus_in) ? TRUE : FALSE;
       /* We pretend that the focus moves to the grab
@@ -864,6 +872,10 @@ _gdk_device_manager_core_handle_focus (GdkWindow *window,
        * grab is in effect
        */
       if (mode != NotifyGrab &&
+#ifdef XINPUT_2
+         mode != XINotifyPassiveGrab &&
+         mode != XINotifyPassiveUngrab &&
+#endif /* XINPUT_2 */
           mode != NotifyUngrab)
         toplevel->has_pointer_focus = (focus_in) ? TRUE : FALSE;
       break;